#ifndef SOCKET_H
#define SOCKET_H

#include <sys/types.h>
#include <netinet/in.h>
#define _GNU_SOURCE
#include <sys/socket.h>
#include <unistd.h>

typedef struct S Socket;
struct S {
  int opt;
  int master_socket;
  struct sockaddr_in address;
  int addrlen;

  int new_socket;

  int client_socket[3];
  int max_clients;

  int activity, loop, loop2, valread;
  char buffer[2049];    /* data buffer of 1K */

  fd_set readfds;
  struct timeval tv;

  char message[160];

    void (*init)(Socket *s);
	int (*getMessage)(Socket *this);

};

#define DEFAULT_PORT 7000
#define MAXLOG 5

Socket *makeSocket(void);

#endif


